//
//  SettingViewController.m
//  KuWeiPark
//
//  Created by Kevin Su on 15/4/29.
//  Copyright (c) 2015年 Clief. All rights reserved.
//

#import "SettingViewController.h"
#import "HttpClientManager.h"
#import "AppDelegate.h"
#import "AppMacro.h"
#import "DataModel.h"

@interface SettingViewController (){
    
    BOOL isScreenSwitchOn;
    BOOL isVoiceOn;
}

@end

@implementation SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.contentHeightConstraint.constant = self.logoutView.frame.origin.y+self.logoutView.frame.size.height+50;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - IBAction

- (IBAction)screenShowValueChanged:(id)sender {
    
    //开启关闭 屏幕常亮
    UISwitch *switchBtn = (UISwitch *)sender;
    if(switchBtn.on){
        
        isScreenSwitchOn = NO;
    }else{
        
        isScreenSwitchOn = YES;
    }
}

- (IBAction)voiceValueChanged:(id)sender {
    
    //语音设置
    UISwitch *switchBtn = (UISwitch *)sender;
    if(switchBtn.on){
        
        isVoiceOn = NO;
    }else{
        
        isVoiceOn = YES;
    }
}

- (IBAction)back:(id)sender {
    
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)logoutAction:(UIButton *)button{
    
    ApplicationDelegate.loginModel = nil;
    [[NSUserDefaults standardUserDefaults] removeObjectForKey:NsUserDefaultKey_LoginModel];
    [[NSNotificationCenter defaultCenter] postNotificationName:Notify_LogoutNotify object:nil];
    [self.navigationController popToRootViewControllerAnimated:YES];
}
@end
